
public class Book {

    private String title, author, subject_area;
    private int ISBN_Number , copies_available;

    public Book(String title, String author, String subject_area, int ISBN_Number, int copies_available) throws Exception{
        this.title = title;
        this.author = author;
        this.subject_area = subject_area;
        this.ISBN_Number = ISBN_Number;
        this.copies_available = copies_available;

        if(checkBookValid()){
            throw new Exception("Invalid book values entered!");
        }
    }

    private boolean checkBookValid() {
        return title.matches(" ");
    }

}
